#!/bin/bash

case "$1" in
"start") 
python manage.py runfcgi method=prefork maxchildren=6 maxspare=4 minspare=2 maxrequests=500 host=127.0.0.1 port=8002 pidfile=/tmp/song.pid;
#../env/bin/python manage.py runfcgi method=threaded host=127.0.0.1 port=8000 pidfile=/tmp/server.pid;
#../env/bin/python manage.py celeryd -B &
;;
"stop") 
kill -9 `cat /tmp/song.pid`
;;
"restart")
$0 stop
sleep 1
$0 start
;;
*) echo "Usage: ./server.sh {start|stop|restart}";;
esac
